package UnOfficeDeTourisme;

/**
 * Interface definition : SGSites
 * 
 * @author OpenORB Compiler
 */
public abstract class SGSitesPOA extends org.omg.PortableServer.Servant
        implements SGSitesOperations, org.omg.CORBA.portable.InvokeHandler
{
    public SGSites _this()
    {
        return SGSitesHelper.narrow(_this_object());
    }

    public SGSites _this(org.omg.CORBA.ORB orb)
    {
        return SGSitesHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGSites:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    private static final java.util.Map operationMap = new java.util.HashMap();

    static {
            operationMap.put("ajouterSite",
                    new Operation_ajouterSite());
            operationMap.put("ajouterTypeEntree",
                    new Operation_ajouterTypeEntree());
            operationMap.put("ajouterVisite",
                    new Operation_ajouterVisite());
            operationMap.put("calculerStatistiques",
                    new Operation_calculerStatistiques());
            operationMap.put("consulterVisite",
                    new Operation_consulterVisite());
            operationMap.put("getAllVisites",
                    new Operation_getAllVisites());
            operationMap.put("getPosProches",
                    new Operation_getPosProches());
            operationMap.put("getTypeEntrees",
                    new Operation_getTypeEntrees());
            operationMap.put("getVisites",
                    new Operation_getVisites());
            operationMap.put("listeDesSites",
                    new Operation_listeDesSites());
            operationMap.put("majSite",
                    new Operation_majSite());
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        final AbstractOperation operation = (AbstractOperation)operationMap.get(opName);

        if (null == operation) {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }

        return operation.invoke(this, _is, handler);
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_ajouterVisite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        UnOfficeDeTourisme.Visite arg1_in = UnOfficeDeTourisme.VisiteHelper.read(_is);

        int _arg_result = ajouterVisite(arg0_in, arg1_in);

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_ajouterSite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.Site arg0_in = UnOfficeDeTourisme.SiteHelper.read(_is);

        int _arg_result = ajouterSite(arg0_in);

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_ajouterTypeEntree(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        float arg1_in = _is.read_float();
        String arg2_in = _is.read_string();

        int _arg_result = ajouterTypeEntree(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getVisites(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int[] arg0_in = UnOfficeDeTourisme.listeLongHelper.read(_is);

        try
        {
            UnOfficeDeTourisme.Visite[] _arg_result = getVisites(arg0_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeVisitesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getAllVisites(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            UnOfficeDeTourisme.Visite[] _arg_result = getAllVisites();

            _output = handler.createReply();
            UnOfficeDeTourisme.listeVisitesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_calculerStatistiques(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.Site[] arg0_in = UnOfficeDeTourisme.listeSitesHelper.read(_is);

        UnOfficeDeTourisme.statistiques _arg_result = calculerStatistiques(arg0_in);

        _output = handler.createReply();
        UnOfficeDeTourisme.statistiquesHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getPosProches(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.GPS arg0_in = UnOfficeDeTourisme.GPSHelper.read(_is);

        try
        {
            UnOfficeDeTourisme.Visite[] _arg_result = getPosProches(arg0_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeVisitesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_majSite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        UnOfficeDeTourisme.datecut arg1_in = UnOfficeDeTourisme.datecutHelper.read(_is);
        UnOfficeDeTourisme.datecut arg2_in = UnOfficeDeTourisme.datecutHelper.read(_is);

        majSite(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getTypeEntrees(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int[] arg0_in = UnOfficeDeTourisme.listeLongHelper.read(_is);

        try
        {
            UnOfficeDeTourisme.TypeEntree[] _arg_result = getTypeEntrees(arg0_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeTypeEntreesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_listeDesSites(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            UnOfficeDeTourisme.Site[] _arg_result = listeDesSites();

            _output = handler.createReply();
            UnOfficeDeTourisme.listeSitesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_consulterVisite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        UnOfficeDeTourisme.Visite _arg_result = consulterVisite(arg0_in);

        _output = handler.createReply();
        UnOfficeDeTourisme.VisiteHelper.write(_output,_arg_result);

        return _output;
    }

    // operation classes
    private abstract static class AbstractOperation {
        protected abstract org.omg.CORBA.portable.OutputStream invoke(
                SGSitesPOA target,
                org.omg.CORBA.portable.InputStream _is,
                org.omg.CORBA.portable.ResponseHandler handler);
    }

    private static final class Operation_ajouterVisite extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_ajouterVisite(_is, handler);
        }
    }

    private static final class Operation_ajouterSite extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_ajouterSite(_is, handler);
        }
    }

    private static final class Operation_ajouterTypeEntree extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_ajouterTypeEntree(_is, handler);
        }
    }

    private static final class Operation_getVisites extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getVisites(_is, handler);
        }
    }

    private static final class Operation_getAllVisites extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getAllVisites(_is, handler);
        }
    }

    private static final class Operation_calculerStatistiques extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_calculerStatistiques(_is, handler);
        }
    }

    private static final class Operation_getPosProches extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getPosProches(_is, handler);
        }
    }

    private static final class Operation_majSite extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_majSite(_is, handler);
        }
    }

    private static final class Operation_getTypeEntrees extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getTypeEntrees(_is, handler);
        }
    }

    private static final class Operation_listeDesSites extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_listeDesSites(_is, handler);
        }
    }

    private static final class Operation_consulterVisite extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGSitesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_consulterVisite(_is, handler);
        }
    }

}
